<?php

namespace app\common\model;

use think\Model;

class UserRecommend extends Model
{
	// 完整数据表名
	protected $table = 'user_recommend';

	// 获取邀请人单日邀请数量
	public function getUserRecommendNum($val,$field = 'mobile')
	{	
		return $this->where([$field=>$val])->count();
	}
	// 插入用户数据
	public function addUserRecommend($mobile) 
	{
		$add_data['mobile'] = $mobile;
		$add_data['create_time'] = time();
		$add_data['create_date'] = date('Y/m/d');
		$this->save($add_data);
	}
}